package com.ymatou.social.api.testcase;

import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.social.api.parameter.GetUserHomePageNoteListBean;
import com.ymatou.social.api.service.GetUserHomePageNoteListCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.AuthCallService;

/**
 * 个人主页-日记列表接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetUserHomePageNoteList {
	private static GetUserHomePageNoteListBean homePageNoteListBean;
	private static GetUserHomePageNoteListCall homePageNoteListCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("个人主页-日记列表接口");
	}

	@Before
	public void caseUp() {
		homePageNoteListBean = new GetUserHomePageNoteListBean();
		homePageNoteListCall = new GetUserHomePageNoteListCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(homePageNoteListCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetUserHomePageNoteList_001() {
		Logger.start(true,"获取日记列表成功");
		try {
			Integer userId = 1113;
			String minTime = "";
			Integer limit = 10;
			String userName = "test007";
			
			Map map2 =AuthCallService.authLogin(userName, "123456");
			String accessToken = (String) map2.get("AccessToken");
			homePageNoteListCall = new GetUserHomePageNoteListCall(accessToken);
			homePageNoteListBean.setUserId(userId);
			homePageNoteListBean.setMinTime(minTime);
			homePageNoteListBean.setLimit(limit);

			homePageNoteListCall.setData(homePageNoteListBean);
			homePageNoteListCall.callService();

			Logger.comment("获取日记列表 call" + homePageNoteListCall.getEntityString());
			Logger.comment("获取日记列表 response" + homePageNoteListCall.getReturnData());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}